#include <bits/stdc++.h>
using namespace std;
class MyStack;
class listNode
{
    friend class MyStack;
    friend class MyQueue;

private:
    int data;
    listNode *next = NULL;
    listNode *before = NULL;

public:
    listNode(){};
    listNode(int nodeData, listNode *succ = NULL){};
};
class MyStack
{
private:
    listNode *topNode;
    listNode *first;
    int stackSize;

public:
    MyStack();
    ~MyStack();

    bool push(const int &);
    bool pop(int &);
    bool getTop(int &);
    void printStack();
};

class MyQueue
{
private:
    // int *queue;
    int capacity;
    // int front;
    // int rear;
    listNode *first = NULL;
    listNode *last = NULL;
    listNode *cnt = NULL;
    int size = 0;

public:
    MyQueue(const int &);
    ~MyQueue();
    bool enQueue(const int &);
    bool deQueue(int &);
    bool getFront(int &);
    void printQueue();
    bool isFull();
};
class stacker
{
private:
    int topn = 0;
    int maxcapacity;
    string *s = NULL;

public:
    stacker();
    stacker(const int &n);
    ~stacker();
    bool empty();
    bool full();
    void push(string a);
    void pop();
    int size();
    string top();
    string *output();
};
bool expressionVal(const string &s_, int &result);
bool postfixExpression(const string &s_, string &s2);
void yanghui(const int &);
